<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        /* documenttype类型的节点的属性只有name是有效的(name属性描述文档的类型) */

        console.log(document.doctype.name)  // 获取文档类型
    </script>
</body>
</html>